import React from 'react';
import { Document, Page } from 'react-pdf';
import PDF from 'react-pdf-js';
import {Icon, NavBar, Pagination,WhiteSpace} from "antd-mobile";
import { MobilePDFReader } from 'react-read-pdf';
import "../../access/启明投顾平台组合交易用户服务协议.pdf";
export default class PdfShow extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            "page": 1,
            "pages": 1
        }
    }

    onDocumentComplete(pages) {
        this.setState({page: 1, pages: pages});
    }

    onChange(page) {
        this.setState({
            page: page,
        });
    }
        render() {
            return (
                <div>
                    <div style={{position:"fixed",zIndex:999,top:0,left:0,width:"110%"}}>
                        <NavBar
                            mode="light"
                            icon={<Icon type="left" style={{color:" #f8a83f"}}/>}
                            onLeftClick={() =>window.history.back(-1)}
                        >附件</NavBar>
                    </div>
                    <WhiteSpace size="lg"/>
                    <MobilePDFReader url={require("../../access/启明投顾平台组合交易用户服务协议.pdf")}/>
                    {/* <PDF
                           file={require("../../../access/启明投顾平台组合交易用户服务协议.pdf")}
                           onDocumentComplete={this.onDocumentComplete.bind(this)}
                           page={this.state.page}
                           scale={0.7}
                       />
                       <Pagination style={{width:"70%",marginLeft:40}}  onChange={this.onChange.bind(this)} total={this.state.pages} current={this.state.page}/>*/}
                </div>
            )
        }
}